<?php
/**
 * dodaj player
 *
 * @param string $url // adres strony
 * @param string $host // nazwa domeny
 * @param string $szablon // szablon skorki strony
 * @param string $theme // wybrana skorka
 * @param string $kolor // wersja kolorystyczna skorki
 * @param string $file // nazwa pliku do wczytania
 * @return string
 * $defaultPath = "{$url}public/skins/{$szablon}/ramki/{$theme}_{$kolor}/{$file}";
 * $userPath = "{$url}public/users/".str_replace('www.','',$host)."/{$file}";
 * 
 * przykład użycia
 * {$player|theme:"http://21w.pl":"21w.pl":"000","000","000000","plik.jpg"}
 */
function smarty_modifier_player($null, $video="", $zdjecie="",$width=0,$height=0){

     if(file_exists("{$zdjecie}")) {
     	$id= uniqid();
		$text = "
		<div id=\"{$id}\"> </div>
		<script type=\"text/javascript\">
		<!--
				var w = {$width};
				var h = {$height};	
				var params = { 	wmode: \"transparent\", menu: \"false\", scale: \"noScale\", allowfullscreen : true, allowscriptaccess : \"always\" };
				swfobject.embedSWF(\"/public/scripts/player/player.swf\", \"{$id}\", w, h, \"9.0.0\",\"\", { file: \"{$video}\",	image: \"{$zdjecie}\" }, params);
		// -->
		</script>
	
		";
		return $text;
     }
	if ($smarty->security &&
		($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
		(require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
		(!smarty_core_is_secure($_params, $smarty)) ) {
		return "/*baner4page: (secure) '$_image_path' not in secure directory*/";
	}        
  
}
?>